package com.sdstc.modules.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sdstc.modules.eneity.PlanEntity;
import org.apache.ibatis.annotations.Select;

/**
 * @author ：wk
 * @date ：Created in 2022/11/2 15:10
 */
public interface PlanDao extends BaseMapper<PlanEntity> {
    @Select("select temp_version_id from person_plan where plan_id = #{planId} limit 1")
    String queryTempIdInPersonPlan(String planId);
    @Select("select temp_version_id from organ_plan where plan_id = #{planId} limit 1")
    String queryTempIdInOrgPlan(String planId);
    @Select("select Max(version) from person_plan where temp_version_id = #{tempIdInPersonPlan}")
    Integer queryVersionInPersonPlan(String tempIdInPersonPlan);
    @Select("select Max(version) from organ_plan where temp_version_id = #{tempIdInPersonPlan}")
    Integer queryVersionInOrgPlan(String tempIdInPersonPlan);
}
